package com.poem.mapper;

import com.github.pagehelper.Page;
import com.poem.annotation.AutoFill;
import com.poem.dto.UserDTO;
import com.poem.dto.UsersPageQueryDTO;
import com.poem.entity.Users;
import com.poem.enumeration.OperationType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @ClassName: UsersMapper
 * @Author: YLY
 * @Description:
 * @Date: 2025/10/24
 * @Version: 1.0
 */
@Mapper
public interface UsersMapper {
    @Select("select * from users order by update_time desc")
    List<Users> queryAllUsers();

    @AutoFill(value = OperationType.UPDATE)
    void updateUser(UserDTO userDTO);

    Page<Users> pageQuery(UsersPageQueryDTO usersPageQueryDTO);

    void deleteBatch(List<Long> ids);

    @Select("select * from users where id = #{id}")
    Users getById(Long id);
}
